package com.example.demo.java8.functionalinterface;

import java.util.function.Consumer;

/**
 * JAVA8 Consumer接口
 *
 * @author luowj12
 * @since 2021/5/10 10:00
 */
public class ConsumerTest {

    public static void main(String[] args) {
        Consumer<Integer> consumer = x -> {
            int a = x + 2;
            System.out.println(a);// 12
            System.out.println(a + "_");// 12_
        };
        consumer.accept(10);

    }

}
